<?php 

include($GLOBALS['LNG'].$_SESSION[$SESSLG]."/main.settings.php");
include($GLOBALS['LNG'].$_SESSION[$SESSLG]."/mod.clients.php");
require_once($_SERVER['DOCUMENT_ROOT'].'/defaultconf.mex');

MYTCONN();

$user = $GLOBALS['MYT']->db_array("SELECT name, staffmember FROM systemoffice.main_users where ref = {$_SESSION[$SESSID]} ");
$staff_member = $user[1]['staffmember'];

$userMail = $GLOBALS['MYT']->db_array("SELECT * FROM systemoffice.staff_members where smb_ID = '{$staff_member}' ");
$userMail2 = $userMail[1]['smb_CttEmail'];

$loja = $GLOBALS['MYT']->db_array("SELECT name FROM systemoffice.main_offices where ref = {$_SESSION[$SESSOF]} ");

$user2 = $user[1]['name'];
$loja2 = $loja[1]['name'];

$Msg = $_POST['mensagem'];

$data = date("Y-m-d H:i:s");

$email_pw = sprintf("
<!DOCTYPE html>
<html>
<head>
<meta http-equiv='expires' content='Mon, 26 Jul 1997 05:00:00 GMT'/>
<meta http-equiv='pragma' content='no-cache' />
<meta charset='utf-8' />
<meta http-equiv='X-UA-Compatible' content='chrome=1'>
<title>Pedido de Mensagem</title>
</head>
<body>
<p><br> <strong>Pedido de Mensagens</strong><br>
=========================================================================================<br>
<strong>Universo</strong>: <br>
<strong>Mensagem</strong>: <a href='mailto:'>".$Msg."</a><br>
</body>
</html>");
	$to = "mario.pais@moneyexpress.pt";
	$subject = $loja[1]['name']." - ".$user[1]['name'];
	$From = '<no-reply@moneyexpress.pt>';
	$reply = '<no-reply@moneyexpress.pt>';
	//authmail($to, $subject, $email_pw,"From:$user2\r\nContent-type: text/html; charset=utf-8", $SERVER);
		$FromName = 'Pedido de Mensagens';
		$toName = 'uu8t6t';
		$Html = '';
		$AttmFiles = '';
	authmail($From,$FromName,$to,$toName,$subject,$email_pw,$email_pw,$AttmFiles,$_sysconfMailString);

	echo "Pedido Enviado. Aguarde Analise e envio.";
?>